import {myFetch} from '@/assets/js/utils.js'
const env = process.env.NODE_ENV

export default{
    // 那一堆收益相关的数字什么的
    async getIncome () {
        const r = await myFetch({
            name: 'shopping.sys.wx.income'
        })
        return r
    },
    // 这里为啥还一定要await??
    async getIncome2 () {
        return myFetch({
            name: 'shopping.sys.mypoint2'
        })
    },
    // 收益明细
    async getRevenueHistory ({page, type}) {
        const r = await myFetch({
            name: 'shopping.sys.wx.records',
            page,
            type
        })
        return r
    },
    async getRevenueMonthly ({page}) {
        const r = await myFetch({
            name: 'shopping.sys.wx.records',
            page,
            type: 6
        })
        return r
    },
    // 上月收益
    async getLastMonth () {
        const r = await myFetch({
            name: 'shopping.sys.wx.getincome'
        })
        return r
    },
    // 转账
    async drawMoney ({amount, datang}) {
        const r = await myFetch({
            name: 'shopping.sys.wx.transfer',
            value: amount,
            datang,
            code: ''
        })
        return r
    }
}
